// BIMFACE 数据服务-图模对比数据相关接口
// https://bimface.com/docs/model-data-service/v1/api-reference/getElementChangeUsingGET.html

import  bimfaceHttp from '@/api/Bimface';

enum Api {
  Comparisons = '/data/v2/comparisons',
}

/**
 * @todo: interface待实现
 * @abstract: 获取模型构件对比差异
 */
export function getComponentComparisonDiff(
  comparisonId: number,
  params: {
    followingElementId: string;
    followingFileId: number;
    previousElementId: string;
    previousFileId: number;
  },
) {
  return bimfaceHttp.get<any>({
    url: Api.Comparisons + `/${comparisonId}/elementChange`,
    params: params,
  });
}

/**
 * @todo: interface待实现
 * @abstract: 获取模型对比构件分类树
 */
export function getComponentComparisonClassificationTree(comparisonId: number) {
  return bimfaceHttp.get<any>({ url: Api.Comparisons + `/${comparisonId}/tree` });
}

/**
 * @todo: interface待实现
 * @abstract: 分页获取模型对比结果
 */
export function getModelComparisonDiffByPage(
  comparisonId: number,
  params: {
    elementName?: string;
    family?: string;
    page?: number;
    pageSize?: number;
  },
) {
  return bimfaceHttp.get<any>({ url: Api.Comparisons + `/${comparisonId}/diff`, params: params });
}

/**
 * @todo: interface待实现
 * @abstract: 分页获取图纸对比结果
 */
export function getDrawingComparisonDiffByPage(
  comparisonId: number,
  params: {
    layer?: string;
    page?: number;
    pageSize?: number;
    sheetID?: string;
    sheetName?: string;
    type?: string;
  },
) {
  return bimfaceHttp.get<any>({
    url: Api.Comparisons + `/${comparisonId}/drawingdiff`,
    params: params,
  });
}
